@extends('backend::layout')

@section('title', '添加学生信息')

@section('content')
    <form method="post">
        {{ csrf_field() }}
        <div class="box box-primary">
            <div class="box-header with-border">
                <div class="col-lg-4">
                    <h3 class="box-title">添加学生信息</h3>
                </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body pad-10">
                <div class="col-lg-4">
                    <div class="form-group @if($errors->has('name')) has-error @endif">
                        <label class="control-label">{{ __("Username") }}</label>
                        <input class="form-control " name="name" type="text" placeholder="{{ __("Username") }}" value="{{ old('name') }}">
                        @if($errors->has('name'))
                            <span class="help-block">{{ $errors->first('name') }}</span>
                        @endif
                    </div>
                </div>
                <div class="col-lg-4">
                    <div class="form-group">
                        <label class="control-label">{{ __('Sex') }}</label>
                        <div class="radio">
                            <label>
                                <input type="radio" value="1" @if(old('sex') === null || old('sex') == 1) checked @endif name="sex">
                                {{ __('Male') }}
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" value="0" @if(old('sex') !== null && old('sex') == 0) checked @endif name="sex">
                                {{ __('Female') }}
                            </label>
                        </div>
                        @if($errors->has('sex'))
                            <span class="help-block text-danger">{{ $errors->first('sex') }}</span>
                        @endif
                    </div>
                </div>
                <div class="col-lg-4">
                    <div class="form-group @if($errors->has('birthday')) has-error @endif">
                        <label class="control-label">生日</label>
                        <div class="input-group date form_date" data-date="" data-date-format="yyyy-mm-dd HH:ii:ss" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd HH:ii:ss">
                            <input class="form-control" size="16" type="text" name="birthday" value="{{ old('birthday') }}" readonly>
                            <span class="input-group-addon"><span class="fa fa-lg fa-calendar"></span></span>
                        </div>
                        @if($errors->has('birthday'))
                            <span class="help-block">{{ $errors->first('birthday') }}</span>
                        @endif
                    </div>
                </div>
                <div class="col-lg-4">
                    <div class="form-group @if($errors->has('address')) has-error @endif">
                        <label class="control-label">{{__("Address")}}</label>
                        <input class="form-control " name="address" type="text" placeholder="{{__("Address")}}" value="{{ old('address') }}">
                        @if($errors->has('address'))
                            <span class="help-block">{{ $errors->first('address') }}</span>
                        @endif
                    </div>
                </div>
                <div class="col-lg-4">
                    <div class="form-group @if($errors->has('phone')) has-error @endif">
                        <label class="control-label">{{ __("Telephone") }}</label>
                        <input class="form-control " name="phone" type="text" placeholder="{{ __("Telephone") }}" value="{{ old('phone') }}">
                        @if($errors->has('phone'))
                            <span class="help-block">{{ $errors->first('phone') }}</span>
                        @endif
                    </div>
                </div>
            </div>

            <!-- /.box-body -->
            <div class="box-footer m-b-2">
                <div class="col-lg-4">
                    <button class="btn btn-primary btn-sm" type="submit">
                        <i class="fa fa-check"></i> {{ __('Save') }}
                    </button>
                    &nbsp;&nbsp;&nbsp;
                    <a class="btn btn-default btn-sm" href="javascript:history.back(-1);">
                        <i class="fa fa-undo"></i> {{ __('Back') }}
                    </a>
                </div>
            </div>
            <!-- /.box-footer -->
        </div>
    </form>
@stop

@section('script')
    <script>
        !function ($) {
            $(function () {
                $('.form_date').datetimepicker({
                    language:  'zh-CN',
                    weekStart: 1,
                    todayBtn:  1,
                    autoclose: 1,
                    todayHighlight: 1,
                    startView: 2,
                    minView: 2,
                    forceParse: 0
                });
            });
        }(jQuery);

    </script>
@stop